<p>Vals的值:@string.Join(",", Vals)</p><br>
<Tree Data="data1" Color="Color.Link" ShowCheckBox @bind-Values="Vals">
    <ItemSlot>
        <div class="@B.Flex @B.JustifyContentSpaceBetween">
            <div>
                <Icon IconClass="fa fa-home"></Icon>
                <span>@context.Text</span>
            </div>
            <span>
                <a>add</a>
                <a>delete</a>
            </span>
        </div>
    </ItemSlot>
</Tree>

@code{

    HashSet<string> Vals = new HashSet<string>();
    //下面为了方便，直接从json文件加载数据
    static string dataFile = "Pages/data/data1.json";
    List<TreeItem<string>> data1 = Tree<string>.BuildDataFromJson(System.IO.File.ReadAllText(dataFile));
}